Sales Tracker
A modern-as-hell, playful web application for tracking sales and wrangling analytics — with an interactive login that's almost too clever for its own good.
Features
- 📊 Sales Analytics Dashboard – Visualize sales like a data-driven badass
- 👥 User Management – Multi-level permissions so your team doesn’t accidentally break stuff
- 📈 Data Entry & Export – Input sales quickly and shoot that crap into Excel
- 🎮 Interactive Login – Cursor-evasive Sign In button just to mess with people
- 🔒 Secure Authentication – Password hashing that even your nosy-ass sysadmin can’t break
- 📱 Responsive Design – Runs smooth on desktop, tablet, or that old phone you still won’t upgrade
Core Functionality
- Employee Management – Add/edit employees, their commissions, draws — the whole damn deal
- Sales Data Entry – Do it by hand or slam in a CSV like a pro
- Analytics Dashboard – Filter and graph until the numbers make sense or you rage-quit
- Admin Panel – Wrapped in password protection, because duh
Database Schema
Your data’s not just dumped — we gave it structure like responsible grownups:
- Employee Table: Tracks the who, what, and when of your sales crew
- Sales Table: Logs every dollar that rolls in
- Settings Table: Keeps track of your system’s default working setup and toggles
- Goals Table: Measure who's slaying and who's slacking
Three Main Pages
1. Management Tab (Locked Behind a Password Wall)
- Admin login with proper credentials (no password123 crap)
- Employee configuration panel
- Settings for system behavior and admin updates
- Switch how commissions & draws are shown — % or actual bucks
- Epic theme picker with 8 presets for maximum visual hell yeah
2. Analytics Page (Wide Frickin’ Open)
- Tracks Year-to-Date stats, or whatever time range floats your fancy
- Uses Chart.js because facts deserve pretty pictures
- Bar, pie, line charts — you name it
- Filter time ranges and export data like an absolute legend
- Adaptive UI responds to theme like a mood ring for business
3. Data Entry Page (Wide Open Like Your Inbox)
- Manual sales input
- Commissions calculated automatically (no more math headaches)
- Draw payment tracking — keep it drama-free
- Upload CSVs and watch it handle bulk data like a champ
- Validates your entries because your future self will thank you
- Keeps the recent entries right where you can see them
Technical Stack
Because building badass tools needs solid tech:
- 🧠 Backend: Flask + SQLAlchemy
- 🐘 Database: SQLite, cause it just works
- 🖋️ Forms: Flask-WTF with CSRF defense
- 🔐 Security: Werk-f’ing-Zeug password hashing for locked-tight sessions
- 💅 Frontend: Bootstrap 5, sexy in all screen sizes
- 📊 Charts: Chart.js — clean, crisp, and fast AF
- 🐳 Deployment: Dockerized and ready to ship
Installation & Setup
Quick Start with Docker (The Way Developers Actually Do It)
Clone this bad boy:
git clone <repository-url> cd sales-tracker chmod +x setup.sh ./setup.sh
Manual Docker Compose (for control freaks):
docker-compose up --build
Launch that sucker:
- Visit http://localhost:5000
- Admin credentials:
admin
/admin
(you’ll wanna change that ASAP)
Setup Options
Dev Mode — a no-pressure playground:
./setup.sh --dev
Production Mode — the serious stuff:
./setup.sh --production
Persistent Mode — the one that doesn’t forget your data:
./setup.sh --persistent
Gives access at http://localhost:5001 if you're following recipes correctly.
Got Database Problems? Let’s Kick Their Ass
Use in-container magic:
docker run -p 5000:5000 -e DATABASE_URL=sqlite:///sales_tracker.db sales-tracker
Fix crappy host permissions:
mkdir -p data uploads chmod 755 data uploads
Or go full persistent mode:
./setup.sh --persistent
Local Dev Setup
Get your damn Python set up:
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
Fire up the beast:
python app.py
Open browser → http://localhost:5000
(Or don’t. Be a rebel.)
Configuration
Environment Sh*t You Shouldn’t Forget
SECRET_KEY
— don’t check this into Git, ya dingusFLASK_ENV
— development or productionDATABASE_URL
— override the default if you like pain
Defaults
- Admin:
admin
- Password:
admin
(again, change it dammit) - Database:
sales_tracker.db
Usage Guide
First-Time Dance
- Load up http://localhost:5000
- Smash that “Admin Login” button
- Change the password — your organization’s honor depends on it
- Add employees like a benevolent god
Logging Sales (a.k.a. The Reason This Sh*t Exists)
- Go to Data Entry
- Type in details
- Let auto-commission math do its thing
- Or bulk upload a fancy-ass CSV
Viewing Analytics
- Hit Analytics
- Filter stuff until it tells you something useful
- Export if your boss wants proof
Managing the Team
- Admin login
- Edit employees or set their goals
- Toggle display settings — % or flat amounts
- Yell at slackers (optional)
Theme Customization (Because Vibes Matter)
- Hit the palette icon in the navbar
- Choose one of the 8 eye-popping themes
- Watch the app change outfits instantly
Themes include:
- Default Blue
- Dark Theme (work in the shadows, baby)
- Nature Green (for tree-huggin’ teams)
- Royal Purple (His Royal Freshness would approve)
- Sunset Orange
- Ocean Teal
- Corporate Red (power tie vibes)
- Modern Pink
Settings persist for admin; guests get localStorage (so they don’t ruin your vibe).
File Structure
sales-tracker/ ├── app.py # Main Flask beast ├── requirements.txt # Python goodies ├── Dockerfile # So your app works on my damn machine too ├── docker-compose.yml # Stack orchestration magic …
API Endpoints
GET /api/sales_data?period=YTD
— give us that chart dataGET /api/trends_data
— how the bloody hell are we doing?POST /bulk_upload
— shove an entire CSV down its throat
Security Features
- Password hashing (locked tighter than grandma’s cookie jar)
- CSRF protection — no cross-site BS allowed
- Session-based ownership
- Input validation so you don’t feed it junk
- SQLAlchemy ORM to dodge SQL injection like Neo
Performance
Fast as hell. Optimized frontend, backend, and everything in between. Ready to scale... maybe.
Maintenance
Backup the Damn DB
docker exec sales-tracker-app sqlite3 /app/sales_tracker.db ".backup /app/data/backup.db"
Update This Beautiful Bastard
docker-compose down docker-compose up --build
Check Logs Like a Debugging Ninja
docker-compose logs -f sales-tracker
Contributing
- Fork it
- Branch it
- Make it better
- Pull request and bask in glory
Support
Issues? Questions? Praise-singing?
File an issue on GitHub or yell at teb.
👑 Created by: tebbydog0605
🐋 Docker Hub: tebwritescode
💻 Website: teb.codes